package com.jlu.test;


import com.jlu.dao.CustomerDao;
import com.jlu.domain.Customer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext.xml")
public class Sqltest {

  @Autowired
  private CustomerDao customerDao;

  //  查询所有
  @Test
  public void findBySql() {
    List<Customer> allBySql = customerDao.findAllBySql();
    System.out.println(allBySql);
  }

  //  根据id查询
  @Test
  public void findByIdBySql(){
    System.out.println(customerDao.findByIdBySql(4l));
  }
}


